import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: "/login"
  },
  {
    path: '/login',
    name: 'Login',
    meta:{ title:'登录' },
    component: () => import('../views/Login.vue')
  },
  {
    path: '/student/index',
    name: 's_index',
    redirect: '/student/select_topic',
    component: () => import("@/views/BasicLayout.vue"),
    children: [
      { path:'/student/select_topic', meta:{ title:'课题选择' }, component:() => import('../views/student/SelectThesis/SelectThesis.vue') },
      { path:'/student/download', meta:{ title:'表格材料下载' }, component:() => import('../views/student/Download/Download.vue') },
      { path:'/student/user_info', meta:{ title:'查看个人信息' } ,component:() => import('../views/student/UserInfo/UserInfo') },
      { path:'/student/manager', meta:{ title:'流程管理' } ,component:() => import('../views/student/Manager/Manager') },
    ]
  },
  {
    path: '/teacher/index',
    name: 't_index',
    redirect: '/teacher/publish_topic',
    component: () => import("@/views/BasicLayout.vue"),
    children: [
      { path: '/teacher/publish_topic', meta:{ title:'发布课题' }, component:() => import('@/views/Teacher/PublishTopic/PublishTopic') },
      { path: '/teacher/topics', meta:{ title:'全部课题' }, component:() => import('@/views/Teacher/AllThesis/AllThesis.vue') },
      { path:'/teacher/user_info', meta:{ title:'个人信息' }, component:() => import('@/views/Teacher/UserInfo/UserInfo') },
      { path:'/teacher/audit', meta:{ title:'课题申请' }, component:() => import('@/views/Teacher/Audit/Audit') },
      { path:'/teacher/guide', meta:{ title:'论文指导' }, component:() => import('@/views/Teacher/Guide/Guide') },
    ]
  },
  {
    path: '/admin/index',
    name: 'a_index',
    redirect: '/admin/add_teacher',
    component: () => import("@/views/BasicLayout.vue"),
    children: [
      { path : '/admin/add_teacher', meta:{ title:'添加教师' }, component: () => import('@/views/Admin/AddTeacher/AddTeacher') },
      { path : '/admin/add_student', meta:{ title:'添加学生' }, component: () => import('@/views/Admin/AddStudent/AddStudent') },
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
